package net.sky.oa.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 员工表
 * SysEmployee. @author hond
 */
@Entity
@Table(name = "SYS_EMPLOYEELEAVE")//员工表
public class SysEmployeeLeave implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields

	protected Long id;
	protected String content;
	protected String time;			//留言时间
	protected Integer type; 		//1悄悄2非
	protected SysEmployee leaveuser;//留言用户
	protected SysEmployee user;		//被留言用户
	// Constructors

	/** default constructor */
	public SysEmployeeLeave() {
	}
	
	@Id
    @Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_SYSEMPLOYEELEAVE_ID",sequenceName="SQ_SYSEMPLOYEELEAVE_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_SYSEMPLOYEELEAVE_ID")
	public Long getId() {
        return id;
    }

    public void setId(Long id){
    	this.id = id;
    }

	/** minimal constructor */
	public SysEmployeeLeave(Long id) {
		this.id = id;
	}
	
	@Column(name = "CONTENT", length = 250)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Column(name = "TIME", length = 20)
	public String getTime() {
		return this.time;
	}
	
	public void setTime(String time) {
		this.time = time;
	}
	
	@Column(name = "TYPE", precision = 2, scale = 0)
	public Integer getType() {
		return this.type;
	}
	
	public void setType(Integer type) {
		this.type = type;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "LEAVEUSER_ID")
	public SysEmployee getLeaveuser() {
		return this.leaveuser;
	}

	public void setLeaveuser(SysEmployee leaveuser) {
		this.leaveuser = leaveuser;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}
	
	public void setUser(SysEmployee user) {
		this.user = user;
	}
}